// 导入 组件
// 首页组件
import Home from '../views/home/Home.vue'
// 个人中心组件
import Center from '../views/center/Center.vue'
// 用户管理组件
import UserAdd from '../views/user-manage/UserAdd.vue'
import UserList from '../views/user-manage/UserList.vue'
// 新闻管理组件
import NewsAdd from '../views/news-manage/NewsAdd.vue'
import NewsList from '../views/news-manage/NewsList.vue'
import NewsEdit from '../views/news-manage/NewsEdit.vue'
// 企业文化组件
import ProductAdd from '../views/product-manage/ProductAdd.vue'
import ProductList from '../views/product-manage/ProductList.vue'
import ProductEdit from '../views/product-manage/ProductEdit.vue'
// 产品管理组件
import BoxAdd from '../views/box-manage/BoxAdd.vue'
import BoxList from '../views/box-manage/BoxList.vue'
import BoxEdit from '../views/box-manage/BoxEdit.vue'
// 文档管理组件
import DocumentationAdd from '../views/documentation-manage/DocumentationAdd.vue'
import DocumentationList from '../views/documentation-manage/DocumentationList.vue'
import DocumentationEdit from '../views/documentation-manage/DocumentationEdit.vue'
// 招聘管理组件
import RecruitAdd from '../views/recruit-manage/RecruitAdd.vue'
import RecruitList from '../views/recruit-manage/RecruitList.vue'
import RecruitEdit from '../views/recruit-manage/RecruitEdit.vue'

// 数据统计组件
import Statistics from '@/views/Statistics/Statistics.vue'

// 错误处理组件
import NotFound from '../views/notfound/NotFound.vue'

const routes = [
    {
        path: "/index",
        component: Home
    },
    {
        path: "/center",
        component: Center
    },
    // 用户管理组件
    {
        path: "/user-manage/adduser",
        component: UserAdd,
        requireAdmin: true
    },
    {
        path: "/user-manage/userlist",
        component: UserList,
        requireAdmin: true
    },
    // 新闻管理组件
    {
        path: "/news-manage/addnews",
        component: NewsAdd,
        requireEditor: true
    },
    {
        path: "/news-manage/newslist",
        component: NewsList,
        requireEditor: true
    },
    {
        path: "/news-manage/editnews/:id",
        component: NewsEdit,
        requireEditor: true
    },
    // 企业文化管理组件
    {
        path: "/product-manage/addproduct",
        component: ProductAdd,
        requireRegular: true
    },
    {
        path: "/product-manage/productlist",
        component: ProductList,
        requireRegular: true
    },
    {
        path: "/product-manage/editproduct/:id",
        component: ProductEdit,
        requireRegular: true
    },
    // 产品管理组件
    {
        path: "/box-manage/addbox",
        component: BoxAdd,
        requireEditor: true
    },
    {
        path: "/box-manage/boxlist",
        component: BoxList,
        requireEditor: true
    },
    {
        path: "/box-manage/editbox/:id",
        component: BoxEdit,
        requireEditor: true
    },
    // 文档管理组件
    {
        path: "/documentation-manage/adddocumentation",
        component: DocumentationAdd,
        requireRegular: true
    },
    {
        path: "/documentation-manage/documentationlist",
        component: DocumentationList,
        requireRegular: true
    },
    {
        path: "/documentation-manage/editdocumentation/:id",
        component: DocumentationEdit,
        requireRegular: true
    },
    // 招聘管理组件
    {
        path: "/recruit-manage/addrecruit",
        component: RecruitAdd,
        requireEditor: true
    },
    {
        path: "/recruit-manage/recruitlist",
        component: RecruitList,
        requireEditor: true
    },
    {
        path: "/recruit-manage/editrecruit/:id",
        component: RecruitEdit,
        requireEditor: true
    },

    // 数据统计组件
    {
        path: "/Statistics-manage",
        component: Statistics,
        requireRegular: true
    },

    // 错误路径处理组件
    {
        path:"/",
        redirect:"/index"
    },
    {
        path:"/:pathMatch(.*)*",
        name:"Notfound",
        component:NotFound
    }
]

export default routes